package neteasy_music

import (
	"GraduationProject/public/models"
	"GraduationProject/public/params"
	"GraduationProject/worker/conf"
	"GraduationProject/worker/neteasy_music/function"
	"GraduationProject/worker/neteasy_music/neteasy_music_conf"
	"fmt"
)

func Run(seed models.Record) (result params.Result, err error) {
	fmt.Println("easy_music_run")
	switch seed.FunctionName {
	case neteasy_music_conf.NetEasyMusicPages:
		fmt.Println(neteasy_music_conf.NetEasyMusicPages)
		return function.Pages(seed), nil
	case neteasy_music_conf.NetEasyMusicSongs:
		fmt.Println(neteasy_music_conf.NetEasyMusicSongs)
		return function.Songs(seed), nil
	case neteasy_music_conf.NetEasyMusicComments:
		fmt.Println(neteasy_music_conf.NetEasyMusicComments)
		return function.Comments(seed), nil
	default:
		return result, conf.ErrDefault
	}
}
